package com.circle.rest.modular.sys.wrapper;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.circle.rest.core.common.model.PageResult;
import com.circle.rest.core.common.wrapper.BaseWrapper;
import com.circle.rest.core.util.ConstantUtil;

import java.util.List;
import java.util.Map;

/**
 * <p>
 * 操作日志记录 包装器
 * </p>
 *
 * @author 赵航
 * @since 2019-03-07
 */
public class OperLogWrapper extends BaseWrapper {
    public OperLogWrapper(Map<String, Object> single) {
        super(single);
    }

    public OperLogWrapper(List<Map<String, Object>> multi) {
        super(multi);
    }

    public OperLogWrapper(Page<Map<String, Object>> page) {
        super(page);
    }

    public OperLogWrapper(IPage<Map<String, Object>> page) {
        super(page);
    }

    public OperLogWrapper(PageResult<Map<String, Object>> pageResult) {
        super(pageResult);
    }

    @Override
    protected void wrapTheMap(Map<String, Object> map) {
        map.put("businessTypeName", ConstantUtil.getBusinessTypeName(map.get("businessType")));
        map.put("statusName", ConstantUtil.getBusinessStatusName(map.get("status")));
        map.put("operatorTypeName", ConstantUtil.getOperatorTypeName(map.get("operatorType")));
    }
}
